<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="${baseUrlStatic}/common/style/bootstrap.min.css" />
    <link rel="stylesheet" href="${baseUrlStatic}/common/style/pagination.css" />
</head>
<body>
<table class="table table-striped table-bordered table-hover">
    <thead>
        <tr>
            <th colspan="7">
                <a href="${baseUrlRoot}/test/add">Add</a>
            </th>
        </tr>
        <tr>
            <th style="width: 50px;">Index</th>
            <th style="width: 50px;">ID</th>
            <th style="width: 100px;">Name</th>
            <th style="width: 100px;">Value</th>
            <th style="width: 120px;">Date</th>
            <th style="width: 100px;">Status</th>
            <th style="width: 150px;">Operation</th>
        </tr>
    </thead>

    <tbody>
    <#if pager.list?? && pager.list?size gt 0>
        <#assign tests = pager.list />
        <#list tests as item>
            <#if item??>
            <tr>
                <td>${item_index+1}</td>
                <td>${item.id}</td>
                <td>${item.name !}</td>
                <td>${item.value !}</td>
                <td>${item.date ? string("yyyy-MM-dd HH:mm:ss")}</td>
                <td>${item.status.getText()}</td>
                <td>
                    <a href="${baseUrlRoot}/test/edit/${item.id}">Edit</a>
                    <a href="${baseUrlRoot}/test/remove/${item.id}">Delete</a>
                </td>
            </tr>
            </#if>
        </#list>
    </#if>
    <tr>
        <td colspan="7">
            <div id="pagebar" class="pagination"></div>
        </td>
    </tr>
    </tbody>
</table>
<script type="text/javascript" src="${baseUrlStatic}/common/script/jquery-1.8.2.js"></script>
<script type="text/javascript" src="${baseUrlStatic}/common/script/bootstrap.min.js"></script>
<script type="text/javascript" src="${baseUrlStatic}/common/script/common.js"></script>
<script type="text/javascript" src="${baseUrlStatic}/common/script/paginator.js"></script>
<script type="text/javascript" src="${baseUrlStatic}/common/script/request.js"></script>
<script type="text/javascript" color="255,0,0" opacity="100" count="50" src="${baseUrlStatic}/common/script/canvas-nest.min.js"></script>
<script type="text/javascript">
    $(function () {
        var action = "${baseUrlRoot}/test?pageIndex=";
        var pageIndex = parseInt('${pager.pageIndex}');
        var pageSize = parseInt('${pager.pageSize}');
        var total = parseInt('${pager.total}');
        new paginator("pagebar", action, total, pageSize, pageIndex).init({
            "first": "首页",
            "prev": "上一页",
            "next": "下一页",
            "last": "最后一页"
        }).paging();
//        $("#pagebar a").find("a").click(function () {
//            var pageIndex = $(this).data("pageindex");
//            var parameter = {
//                "pageIndex": pageIndex,
//                "pageSize": pageSize
//            };
//            Request(action, parameter, "_self", "post");
//            return false;
//        });
    });
</script>
</body>
</html>